package com.it.slideback;

import android.os.Bundle;

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;

public class MainActivity extends SwipeBackBaseActivity {

    private SlidingMenu mLeftMenu;
    private int width;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
//        setBehindContentView(R.layout.layout);
        SlidingMenu menu = new SlidingMenu(this);
        menu.setMode(SlidingMenu.LEFT);
        menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
//        menu.setShadowWidthRes(R.dimen.shadow_width);
//        menu.setShadowDrawable(R.drawable.shadow);
//        menu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
//        menu.setFadeDegree(0.35f);
        width = getWindowManager().getDefaultDisplay().getWidth();

        menu.setFadeEnabled(false);
        menu.setBehindScrollScale(1);
        menu.setBehindOffset(width-300);

        menu.setShadowWidthRes(R.dimen.shadow_width);
        menu.setMenu(R.layout.layout);
        menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);

        menu.setOnOpenedListener(new SlidingMenu.OnOpenedListener() {
            @Override
            public void onOpened() {
                System.out.println("打开了。。。。。。");
//                scrollToFinishActivity();
            }
        });

  /*      mLeftMenu = (SlidingMenu) findViewById(R.id.slidingmenulayout);
        // configure the SlidingMenu
        // SlidingMenu menu = new SlidingMenu(this);
        mLeftMenu.setMode(SlidingMenu.LEFT);
        // 设置触摸屏幕的模式
        mLeftMenu.se*/

    }
}
